<?php
class Items extends Zend_Db_Table_Abstract {
    protected $_rowClass = 'ItemRow';
	protected $_name = 'items';
	protected $_dependentTables = array('BossesItems','RaidDrops');


	/**
	 * Short hand for getting a raid by its id.
	 * 
	 * This function does mysql safe escaping on the raid id.
	 *
	 * @param 	int 			raid id
	 * @return 	TableRow|null
	 */
	public static function getById($itemId)
	{	
		// Raid id must be numeric
		if (!is_numeric($itemId)) {
			return null;
		}
		
		// Create static self
		$table = new self();
		
		// Create a select for getting the raid
		$select = $table->select()->where("id = ?", $itemId);
		$item = $table->fetchRow($select);
		
		// Return the raid or null
		if ($item) {
			return $item;
		} else {
			return null;
		}
	}
}
?>